
import Vue from 'vue';
import Router from 'vue-router';
import login from '@/views/login';
import about from '@/views/about';
import index from '@/views/index';
import user from '@/views/system/user';
import Module from '@/views/system/Module';
import Role from '@/views/system/Role';
import Permission from '@/views/system/Permission';
import option from "@/views/monitor/option"
import log from "@/views/monitor/login/log"
import cache from "@/views/monitor/cache/index"
import server from '@/views/monitor/server/index';
import doc from '@/views/doc';
import statistics from "@/views/charts/statistics"
import notice from "@/views/notice/index.vue"
import order from "@/views/pay/order"
import teacher from "@/views/teacher/index"
import capter from "@/views/class/capter.vue";
import classify from "@/views/class/classify.vue";
import freeclass from "@/views/class/freeclass.vue";
import live from "@/views/class/live.vue";
import video from "@/views/class/video.vue";
import market from "@/views/pay/list"
import form from "@/views/class/form.vue"
import personal from "@/views/personal"
import student from "@/views/student"

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [{
    path: '/',
    name: '首页',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/login',
    name: '登录',
    component: login,
    hidden: true,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/index',
    name: '首页',
    component: index,
    iconCls: 'el-icon-tickets',
    children: [
      {
        path: '/system/module',
        name: '菜单管理',
        component: Module,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/notice',
        name: '通知管理',
        component: notice,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/system/permission',
        name: '权限管理',
        component: Permission,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/system/user',
        name: '用户管理',
        component: user,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/student',
        name: '学生管理',
        component: student,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/system/role',
        name: '角色管理',
        component: Role,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/pay/order',
        name: '订单管理',
        component: order,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/teacher',
        name: '讲师管理',
        component: teacher,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/teacher/create',
        name: '添加讲师',
        component: () => import('@/views/teacher/form.vue'),
        meta: {
          requireAuth: true
        }
      },
      {
        path: 'teacher/edit/:id',
        name: '编辑讲师',
        component: () => import('@/views/teacher/form.vue'),
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/couponInfo/show/:id',
        name: '优惠券详情',
        component: () => import('@/views/pay/show.vue'),
        meta: {
          requireAuth: true
        }
      },
       {
        path: '/monitor/cache',
        name: '缓存监控',
        component: cache,
        meta: {
          requireAuth: true
        }
      }, {
        path: '/monitor/server',
        name: '服务监控',
        component: server,
        meta: {
          requireAuth: true
        }
      },{
        path: '/doc',
        name: '接口文档',
        component: doc,
        meta: {
          requireAuth: true
        }
      }, {
        path: '/login/log',
        name: '登录日志',
        component: log,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/opt/log',
        name: '操作日志',
        component: option,
        meta: {
          requireAuth: true
        }
      }, {
        path: '/charts/statistics',
        name: '图表',
        component: statistics,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/class/classify',
        name: '课程分类管理',
        component: classify,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/class/freeclass',
        name: '免费课程管理',
        component: freeclass,
        meta: {
          requireAuth: true
        },
      },

      {
        path: '/class/info/:id',
        name: 'CourseInfo',
        component: form,
        meta: { title: '发布课程' ,  requireAuth: true},
        hidden: true
      },
      {
        path: '/class/info',
        name: 'CourseInfo',
        component: form,
        meta: { title: '发布课程' ,  requireAuth: true},
        hidden: true
      },
      {
        path: '/class/chapter/:id',
        name: 'CourseChapterEdit',
        component: form,
        meta: { title: '编辑大纲' },
        hidden: true
      },



      {
        path: '/class/live',
        name: '直播课程管理',
        component: live,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/class/video',
        name: '视频管理',
        component: video,
        meta: {
          requireAuth: true
        }
      },{
        path: '/pay/list',
        name: '营销管理',
        component: market,
        meta: {
          requireAuth: true
        }
      },
      {
        path: '/about',
        name: '关于我',
        component: about,
        meta: {
          requireAuth: true
        }
      },{
        path:'/personal',
        name:'个人中心',
        component: personal,
        meta:{
          requireAuth: true
        }
      }
    ]
  }]
})
